package com.cci.zkweb.core.entity.p8;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.filenet.api.collection.StringList;

public class ClassProperty {
	private String id;
	private String name;
	private Object value;
	
	private boolean isSystem;
	private boolean isHidden;
	
	public ClassProperty() {
		
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	public String getStringValue() {
		String retValue = "[ND]";
		if(value != null) {
			if(value instanceof StringList) {
				StringList sl = (StringList)value;
				for(Object o : sl)
					retValue += "; " + o.toString();
			} else if(value instanceof Date) {
				retValue = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format((Date)value);
			} else {
				retValue = value.toString();
			}
		} 
		return retValue;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Object getValue() {
		return value;
	}

	public void setValue(Object value) {
		this.value = value;
	}

	public boolean isSystem() {
		return isSystem;
	}

	public void setSystem(boolean isSystem) {
		this.isSystem = isSystem;
	}

	public boolean isHidden() {
		return isHidden;
	}

	public void setHidden(boolean isHidden) {
		this.isHidden = isHidden;
	}
	
}
